package org.darkforest.common.services.impl;

import org.darkforest.common.services.SellerService;
import org.darkforest.dao.mapper.SellerMapper;
import org.darkforest.model.Seller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * Created by Administrator on 2015/12/18.
 */
@Service(value = "sellerCommonService")
public class SellerServiceImpl implements SellerService {

    @Autowired
    private SellerMapper sellerMapper;

    @Override
    public int deleteByPrimaryKey(Integer sellerId) {
        return sellerMapper.deleteByPrimaryKey(sellerId);
    }

    @Override
    public int insert(Seller record) {
        return sellerMapper.insert(record);
    }

    @Override
    public int insertSelective(Seller record) {
        return sellerMapper.insertSelective(record);
    }

    @Override
    public Seller selectByPrimaryKey(Integer sellerId) {
        return sellerMapper.selectByPrimaryKey(sellerId);
    }

    @Override
    public Seller selectBySellerName(String sellerName) {
        return sellerMapper.selectBySellerName(sellerName);
    }

    @Override
    public List selectAllSeller() {
        return sellerMapper.selectAllSeller();
    }

    @Override
    public int updateByPrimaryKeySelective(Seller record) {
        return sellerMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(Seller record) {
        return sellerMapper.updateByPrimaryKey(record);
    }

    @Override
    public List<Seller> findSellerByCondition(Seller record) {
        return sellerMapper.findSellerByCondition(record);
    }

    @Override
    public int deleteByStoreId(Integer storeId) {
        return sellerMapper.deleteByStoreId(storeId);
    }

    /**
     * 在编辑时 查询除本身之后的相同数据
     *
     * @param map
     * @return
     */
    @Override
    public List<Seller> findSellerExceptSelf(Map<String, Object> map) {
        return sellerMapper.findSellerExceptSelf(map);
    }
}
